package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);not null;unique" json:"username"`
	Password string `gorm:"type:varchar(40);not null" json:"password"`
}

func (u *User) Create() error {
	return DB.Create(&u).Error
}
func (u *User) GetInfoByUser(username string) error {
	return DB.Where("username = ?", username).Find(&u).Error
}
